Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-duplicate passwords imports #2920

Merged
merged 21 commits into from
Jul 5, 2024
Merged

De-duplicate passwords imports #2920

merged 21 commits into from
Jul 5, 2024

Conversation

graeme
Copy link
Collaborator

@graeme graeme commented Jun 27, 2024

Task/Issue URL: https://app.asana.com/0/1202926619870900/1207598052765981/f
Tech Design URL: https://app.asana.com/0/1202926619870900/1207676132777813/f

Description:

Duplicated passwords are a frequently-reported challenge in adopting our password manager.
Users who import twice or from two different sources may find themselves with hundreds of duplicated entries, making their UI a mess.
This change means that, upon import, passwords that are already stored are not duplicated.

Steps to test this PR:

  1. Download latest build from Builds: Deduplicate passwords on import
  2. Reset your autofill data (Debug → Reset Data → Reset Autofill Data)
  3. Import login_deduplication_starting_data.csv from ✓ CSV files with test cases: 0.5 days
  4. Check your logins to ensure that all 17 entries have been imported
  5. Import login_deduplication_test_data.csv from ✓ CSV files with test cases: 0.5 days
  6. Check against ✓ Define a duplicate: 0.5 days rules to make sure duplicates have been removed (the title/notes values should help you identify each case against the examples defined in the rules).
  7. Import login_import_data_large.csv from ✓ CSV files with test cases: 0.5 days to test large import data sets
  8. Import the data from the previous step again to test large import data + large stored data sets
  9. This could be better and I'm timeboxing some low-hanging fruit optimisations to see if can be improved while trying to avoid DB schema changes that may require a migration
  10. The autofill UI is currently not handling large volumes of data very well even before this project. This is being discussed and tracked in Logins/Autofill: improve list view performance

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation
Download latest build from Builds: Deduplicate passwords on import
Reset your autofill data (Debug → Reset Data → Reset Autofill Data)
Import login_deduplication_starting_data.csv from ✓ CSV files with test cases: 0.5 days
Check your logins to ensure that all 17 entries have been imported
Import login_deduplication_test_data.csv from ✓ CSV files with test cases: 0.5 days
Check against ✓ Define a duplicate: 0.5 days rules to make sure duplicates have been removed (the title/notes values should help you identify each case against the examples defined in the rules).
Import login_import_data_large.csv from ✓ CSV files with test cases: 0.5 days to test large import data sets
Import the data from the previous step again to test large import data + large stored data sets
This could be better and I'm timeboxing some low-hanging fruit optimisations to see if can be improved while trying to avoid DB schema changes that may require a migration
The autofill UI is currently not handling large volumes of data very well even before this project. This is being discussed and tracked in Logins/Autofill: improve list view performance

@graeme graeme marked this pull request as draft June 27, 2024 20:28
Copy link
Contributor

@aataraxiaa aataraxiaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far @graeme. Thanks for the clear naming on the test credentials, super helpful 🙂. Left minor comment formatting suggestion. I can review new commits when they are ready.

@@ -41,3 +41,12 @@ extension Optional: OptionalProtocol {
}

}

extension Optional where Wrapped == String {
var isNilOrEmpty: Bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@graeme graeme force-pushed the graeme/deduplicate-passwords branch from 314cb1b to 3e00442 Compare July 5, 2024 12:26
@graeme graeme marked this pull request as ready for review July 5, 2024 13:09
Copy link
Contributor

@aataraxiaa aataraxiaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM! Nice one @graeme 🚀

@@ -186,7 +198,11 @@ final class MockSecureVault<T: AutofillDatabaseProvider>: AutofillSecureVault {
return nil
}

func inDatabaseTransaction(_ block: @escaping (Database) throws -> Void) throws {}
var spyInDatabaseTransactionBlock: ((Database) throws -> Void)?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this naming 😄

@graeme graeme requested a review from aataraxiaa July 5, 2024 14:53
Copy link

github-actions bot commented Jul 5, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against e7b4fd0

Copy link
Contributor

@aataraxiaa aataraxiaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just have some failing Swiftlint rules.

@graeme graeme merged commit 8d8710a into main Jul 5, 2024
19 checks passed
@graeme graeme deleted the graeme/deduplicate-passwords branch July 5, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants